import React from 'react'
import { Redirect } from 'umi'

export default function Auth(props: any) {
  localStorage.setItem('token', '1254')
  if (localStorage.getItem('token')) {
    return (
      <div>
        <h1>Auth</h1>
        {props.children}
      </div>
    )
  }
  return <Redirect to="/login" />


}
